package com.henghai.zhenxuan.ui.page.signin;

import com.henghai.zhenxuan.BR;
import com.henghai.zhenxuan.R;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;
import com.kunminx.architecture.ui.page.BaseFragment;
import com.kunminx.architecture.ui.page.DataBindingConfig;
import com.kunminx.architecture.ui.page.StateHolder;

public class SignInRuleFragment extends BaseFragment {

    private SignInRuleStates mStates;

    @Override
    protected void initViewModel() {
        mStates = getFragmentScopeViewModel(SignInRuleStates.class);
    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.fragment_sign_in_rule, BR.vm, mStates).addBindingParam(BR.listener, new ListenerHandler());
    }

    public class ListenerHandler implements OnTitleBarListener {
        @Override
        public void onLeftClick(TitleBar titleBar) {
            OnTitleBarListener.super.onLeftClick(titleBar);
            nav().navigateUp();
        }

        @Override
        public void onRightClick(TitleBar titleBar) {
            OnTitleBarListener.super.onRightClick(titleBar);
        }
    }

    public static class SignInRuleStates extends StateHolder {

    }
}
